<div class="problemindexholder" problemindex="C">
 <div class="ttypography">
  <div class="problem-statement">
   <div class="header">
    <div class="title">
     C. Jury Marks
    </div>
    <div class="time-limit">
     <div class="property-title">
      time limit per test
     </div>
     2 seconds
    </div>
    <div class="memory-limit">
     <div class="property-title">
      memory limit per test
     </div>
     256 megabytes
    </div>
    <div class="input-file">
     <div class="property-title">
      input
     </div>
     standard input
    </div>
    <div class="output-file">
     <div class="property-title">
      output
     </div>
     standard output
    </div>
   </div>
   <div>
    <p>
     Polycarp watched TV-show where
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     jury members one by one rated a participant by adding him a certain number of points (may be negative, i. e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the
     <span class="tex-span">
      <i>
       i
      </i>
     </span>
     -th jury member gave
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
     </span>
     points.
    </p>
    <p>
     Polycarp does not remember how many points the participant had before this
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     marks were given, but he remembers that among the scores announced after each of the
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     judges rated the participant there were
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     (
     <span class="tex-span">
      <i>
       n
      </i>
      ≤
      <i>
       k
      </i>
     </span>
     ) values
     <span class="tex-span">
      <i>
       b
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       b
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (it is guaranteed that all values
     <span class="tex-span">
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        j
       </i>
      </sub>
     </span>
     are distinct). It is possible that Polycarp remembers not all of the scores announced, i. e.
     <span class="tex-span">
      <i>
       n
      </i>
      &lt;
      <i>
       k
      </i>
     </span>
     . Note that the initial score wasn't announced.
    </p>
    <p>
     Your task is to determine the number of options for the score the participant could have before the judges rated the participant.
    </p>
   </div>
   <div class="input-specification">
    <div class="section-title">
     Input
    </div>
    <p>
     The first line contains two integers
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     and
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     (
     <span class="tex-span">
      1 ≤
      <i>
       n
      </i>
      ≤
      <i>
       k
      </i>
      ≤ 2 000
     </span>
     ) — the number of jury members and the number of scores Polycarp remembers.
    </p>
    <p>
     The second line contains
     <span class="tex-span">
      <i>
       k
      </i>
     </span>
     integers
     <span class="tex-span">
      <i>
       a
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       a
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        k
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      - 2 000 ≤
      <i>
       a
      </i>
      <sub class="lower-index">
       <i>
        i
       </i>
      </sub>
      ≤ 2 000
     </span>
     ) — jury's marks in chronological order.
    </p>
    <p>
     The third line contains
     <span class="tex-span">
      <i>
       n
      </i>
     </span>
     <span class="tex-font-style-bf">
      distinct
     </span>
     integers
     <span class="tex-span">
      <i>
       b
      </i>
      <sub class="lower-index">
       1
      </sub>
      ,
      <i>
       b
      </i>
      <sub class="lower-index">
       2
      </sub>
      , ...,
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        n
       </i>
      </sub>
     </span>
     (
     <span class="tex-span">
      - 4 000 000 ≤
      <i>
       b
      </i>
      <sub class="lower-index">
       <i>
        j
       </i>
      </sub>
      ≤ 4 000 000
     </span>
     ) — the values of points Polycarp remembers. Note that these values are not necessarily given in chronological order.
    </p>
   </div>
   <div class="output-specification">
    <div class="section-title">
     Output
    </div>
    <p>
     Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "
     <span class="tex-font-style-tt">
      0
     </span>
     " (without quotes).
    </p>
   </div>
   <div class="sample-tests">
    <div class="section-title">
     Examples
    </div>
    <div class="sample-test">
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>4 1<br/>-5 5 0 20<br/>10<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>3<br/></pre>
     </div>
     <div class="input">
      <div class="title">
       Input
      </div>
      <pre>2 2<br/>-2000 -2000<br/>3998000 4000000<br/></pre>
     </div>
     <div class="output">
      <div class="title">
       Output
      </div>
      <pre>1<br/></pre>
     </div>
    </div>
   </div>
   <div class="note">
    <div class="section-title">
     Note
    </div>
    <p>
     The answer for the first example is
     <span class="tex-span">
      3
     </span>
     because initially the participant could have
     <span class="tex-span">
      - 10
     </span>
     ,
     <span class="tex-span">
      10
     </span>
     or
     <span class="tex-span">
      15
     </span>
     points.
    </p>
    <p>
     In the second example there is only one correct initial score equaling to
     <span class="tex-span">
      4 002 000
     </span>
     .
    </p>
   </div>
  </div>
  <p>
  </p>
 </div>
</div>
